<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>自动化构建与部署：现代软件开发的加速器</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
        }
        .code-block {
            background: #1e1e1e;
            color: #d4d4d4;
            border-radius: 8px;
            overflow-x: auto;
        }
        .drop-cap {
            float: left;
            font-size: 4rem;
            line-height: 1;
            font-weight: 700;
            margin-right: 0.5rem;
            color: #667eea;
            font-family: 'Noto Serif SC', serif;
        }
        .section-number {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            background: #667eea;
            color: white;
            border-radius: 50%;
            font-weight: 700;
            margin-right: 1rem;
        }
        .mermaid {
            display: flex;
            justify-content: center;
            margin: 2rem 0;
        }
        .benefit-card {
            background: white;
            border-radius: 12px;
            padding: 1.5rem;
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
            transition: all 0.3s ease;
            border-top: 4px solid #667eea;
        }
        .benefit-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-6">
        <div class="max-w-6xl mx-auto text-center">
            <h1 class="text-5xl md:text-6xl font-bold mb-6 tracking-tight">
                自动化构建与部署
            </h1>
            <p class="text-xl md:text-2xl mb-8 opacity-90">
                现代软件开发的加速器
            </p>
            <div class="flex justify-center space-x-8 text-sm md:text-base">
                <div class="flex items-center">
                    <i class="fas fa-rocket mr-2"></i>
                    <span>提升交付速度</span>
                </div>
                <div class="flex items-center">
                    <i class="fas fa-shield-alt mr-2"></i>
                    <span>减少人为错误</span>
                </div>
                <div class="flex items-center">
                    <i class="fas fa-sync-alt mr-2"></i>
                    <span>持续集成部署</span>
                </div>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <main class="max-w-6xl mx-auto px-6 py-12">
        <!-- Introduction -->
        <section class="bg-white rounded-2xl shadow-xl p-8 md:p-12 mb-12">
            <p class="text-lg leading-relaxed text-gray-700">
                <span class="drop-cap">在</span>现代软件开发中，<strong class="text-purple-700">自动化构建与部署</strong>是 DevOps 体系中不可或缺的组成部分。一个高效的自动化 CI/CD（持续集成/持续部署）流水线，可以帮助开发团队提升交付速度、减少人为错误、提高代码质量，同时加速反馈周期，让代码更快地从开发环境推进到生产环境。
            </p>
        </section>

        <!-- Section 1: Why Automation -->
        <section class="mb-16">
            <div class="flex items-center mb-8">
                <span class="section-number">1</span>
                <h2 class="text-3xl font-bold text-gray-800">为什么要实现自动化构建与部署？</h2>
            </div>
            
            <div class="bg-white rounded-xl p-8 mb-8 shadow-lg">
                <p class="text-lg mb-6 text-gray-700">在传统的软件开发模式中，代码构建和部署往往需要开发人员手动执行多个步骤：</p>
                
                <div class="grid md:grid-cols-2 gap-4 mb-8">
                    <div class="flex items-start space-x-3 bg-gray-50 p-4 rounded-lg">
                        <i class="fas fa-terminal text-purple-600 mt-1"></i>
                        <p class="text-gray-700">代码编写完成后，手动运行 <code class="bg-gray-800 text-green-400 px-2 py-1 rounded text-sm">mvn package</code> 进行打包</p>
                    </div>
                    <div class="flex items-start space-x-3 bg-gray-50 p-4 rounded-lg">
                        <i class="fas fa-upload text-purple-600 mt-1"></i>
                        <p class="text-gray-700">上传 JAR 包或 WAR 包到服务器</p>
                    </div>
                    <div class="flex items-start space-x-3 bg-gray-50 p-4 rounded-lg">
                        <i class="fas fa-server text-purple-600 mt-1"></i>
                        <p class="text-gray-700">远程登录服务器，手动运行 <code class="bg-gray-800 text-green-400 px-2 py-1 rounded text-sm">java -jar</code> 启动应用</p>
                    </div>
                    <div class="flex items-start space-x-3 bg-gray-50 p-4 rounded-lg">
                        <i class="fas fa-code-branch text-purple-600 mt-1"></i>
                        <p class="text-gray-700">处理各种版本管理问题</p>
                    </div>
                </div>

                <h3 class="text-xl font-bold mb-6 text-gray-800">自动化带来的核心价值</h3>
                
                <div class="grid md:grid-cols-2 lg:grid-cols-4 gap-6">
                    <div class="benefit-card">
                        <i class="fas fa-check-circle text-3xl text-purple-600 mb-3"></i>
                        <h4 class="font-bold text-lg mb-2">减少人为错误</h4>
                        <p class="text-gray-600 text-sm">消除重复性手工操作导致的失误</p>
                    </div>
                    <div class="benefit-card">
                        <i class="fas fa-tachometer-alt text-3xl text-purple-600 mb-3"></i>
                        <h4 class="font-bold text-lg mb-2">提高交付效率</h4>
                        <p class="text-gray-600 text-sm">代码提交后自动构建、测试、部署</p>
                    </div>
                    <div class="benefit-card">
                        <i class="fas fa-layer-group text-3xl text-purple-600 mb-3"></i>
                        <h4 class="font-bold text-lg mb-2">统一构建环境</h4>
                        <p class="text-gray-600 text-sm">避免"在我本地可以运行"问题</p>
                    </div>
                    <div class="benefit-card">
                        <i class="fas fa-undo text-3xl text-purple-600 mb-3"></i>
                        <h4 class="font-bold text-lg mb-2">快速回滚</h4>
                        <p class="text-gray-600 text-sm">快速回退到上一个稳定版本</p>
                    </div>
                </div>
            </div>
        </section>

        <!-- CI/CD Pipeline Visualization -->
        <section class="mb-16">
            <div class="bg-gradient-to-r from-purple-50 to-blue-50 rounded-2xl p-8 shadow-lg">
                <h3 class="text-2xl font-bold mb-6 text-center text-gray-800">CI/CD 流水线架构</h3>
                <div class="mermaid">
                    graph LR
                        A[开发者提交代码] -->|Git Push| B[代码仓库]
                        B --> C[CI/CD 触发器]
                        C --> D[自动化构建]
                        D --> E[单元测试]
                        E --> F[集成测试]
                        F --> G[打包部署]
                        G --> H[生产环境]
                        
                        style A fill:#667eea,stroke:#fff,color:#fff
                        style H fill:#48bb78,stroke:#fff,color:#fff
                        style D fill:#ed8936,stroke:#fff,color:#fff
                        style E fill:#ed8936,stroke:#fff,color:#fff
                        style F fill:#ed8936,stroke:#fff,color:#fff
                </div>
            </div>
        </section>

        <!-- Section 2: Maven/Gradle -->
        <section class="mb-16">
            <div class="flex items-center mb-8">
                <span class="section-number">2</span>
                <h2 class="text-3xl font-bold text-gray-800">自动化构建：使用 Maven/Gradle</h2>
            </div>

            <!-- Maven Section -->
            <div class="bg-white rounded-xl shadow-lg mb-8 overflow-hidden">
                <div class="bg-gradient-to-r from-orange-500 to-red-500 text-white p-6">
                    <h3 class="text-2xl font-bold flex items-center">
                        <i class="fab fa-java mr-3"></i>
                        使用 Maven 进行自动化构建
                    </h3>
                </div>
                <div class="p-8">
                    <p class="text-lg mb-6 text-gray-700">Maven 是 Java 生态中最常用的构建工具，它可以管理依赖、编译代码、运行测试、打包 JAR/WAR 以及执行部署。</p>
                    
                    <h4 class="font-bold text-lg mb-4 text-gray-800">Maven 构建 Java 项目主要步骤：</h4>
                    
                    <div class="mb-6">
                        <div class="flex items-center mb-3">
                            <span class="bg-orange-500 text-white rounded-full w-8 h-8 flex items-center justify-center font-bold mr-3">1</span>
                            <h5 class="font-bold text-gray-800">定义 POM 文件（<code class="bg-gray-100 px-2 py-1 rounded">pom.xml</code>）</h5>
                        </div>
                        <ul class="ml-11 space-y-2 text-gray-700 mb-4">
                            <li class="flex items-start"><i class="fas fa-check text-green-500 mr-2 mt-1"></i>依赖管理（Spring Boot、Lombok、MySQL 驱动等）</li>
                            <li class="flex items-start"><i class="fas fa-check text-green-500 mr-2 mt-1"></i>插件配置（编译插件、测试插件、打包插件等）</li>
                            <li class="flex items-start"><i class="fas fa-check text-green-500 mr-2 mt-1"></i>Profile（区分开发、测试、生产环境）</li>
                        </ul>
                        
                        <pre class="code-block p-4 text-sm overflow-x-auto"><code>&lt;project&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;com.ts&lt;/groupId&gt;
    &lt;artifactId&gt;my-app&lt;/artifactId&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
    &lt;dependencies&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
            &lt;artifactId&gt;spring-boot-starter&lt;/artifactId&gt;
            &lt;version&gt;2.7.2&lt;/version&gt;
        &lt;/dependency&gt;
    &lt;/dependencies&gt;
    &lt;build&gt;
        &lt;plugins&gt;
            &lt;plugin&gt;
                &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                &lt;version&gt;3.8.1&lt;/version&gt;
                &lt;configuration&gt;
                    &lt;source&gt;11&lt;/source&gt;
                    &lt;target&gt;11&lt;/target&gt;
                &lt;/configuration&gt;
            &lt;/plugin&gt;
        &lt;/plugins&gt;
    &lt;/build&gt;
&lt;/project&gt;</code></pre>
                    </div>

                    <div>
                        <div class="flex items